﻿using System;
using System.Linq;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;

namespace PDAProject
{
    public partial class Pedidos : Form
    {
        private int nroPedido = 0;
        private string nroEmpleado;

        public int NroPedido
        {
            get { return nroPedido; }
        }
       
        public Pedidos(int nroEmp)
        {
            InitializeComponent();
            PDAProject.localhost.Service1 servicio = new PDAProject.localhost.Service1();
            servicio.Url = "http://192.168.252.81:51603/Service1.asmx";
            dataGrid1.DataSource = servicio.ListarPedidosSinFinalizarDeTecnico(nroEmp);
            nroEmpleado = nroEmp.ToString();
        }

        private void dataGrid1_DoubleClick(object sender, EventArgs e)
        {
            var miPedido = dataGrid1[dataGrid1.CurrentRowIndex, 0];
            nroPedido = int.Parse(miPedido.ToString());

            //Inicio inicioForm = new Inicio(nroEmpleado);
            //inicioForm.ShowDialog();
            Close();
        }

        private void button1_Click(object sender, EventArgs e)
        {

            //Inicio inicioForm = new Inicio(nroEmpleado);
            //inicioForm.ShowDialog();
            Close();
        }

    }
}